Skip to content

[codex] Add Claude Code local reading assistant#348

Draft
railgun0325 wants to merge 3 commits into
codedogQBY:mainfrom
railgun0325:codex/claude-code-deepseek-reader
Draft

[codex] Add Claude Code local reading assistant#348
railgun0325 wants to merge 3 commits into
codedogQBY:mainfrom
railgun0325:codex/claude-code-deepseek-reader

Conversation

@railgun0325
Copy link
Copy Markdown

Summary

This PR adds a desktop-only Claude Code local reading assistant path while keeping the existing ReadAny chat UI and StreamingChat public API stable.

The new path runs the local claude CLI directly from Tauri with stream-json output. It does not start a local HTTP bridge and does not store provider API keys in ReadAny. Model/provider routing, including DeepSeek-backed Claude Code setups, stays in the user's local Claude Code environment.

Interface contract

The interface is documented in docs/claude-code-interface.md and covers:

  • the unchanged frontend entry point: StreamingChat.stream(options);
  • optional desktop-only platform methods: runClaudeCodeChat, abortClaudeCodeChat, checkClaudeCode, and extractBookChapter;
  • Tauri commands: claude_code_check, claude_code_chat, and claude_code_abort;
  • the claude-code-chat-event payload shape for stdout, stderr, and exit events;
  • Claude Code stream-json to ReadAny event mapping;
  • the local readany / readany-ops protocol for book search, notes, highlights, bookmarks, threads, and skills;
  • per-book memory storage and compaction behavior.

Behavior changes

  • Replaces the desktop reading chat execution path with a Claude Code adapter.
  • Restricts Claude Code tools to WebSearch and WebFetch for the reading assistant.
  • Adds hidden Windows child process launch so Claude Code does not open an extra console window.
  • Resolves ReadAny tool book references from current book, direct id, exact title, and unique partial title.
  • Automatically continues the Claude Code turn after ReadAny tool operations execute, instead of stopping after a tool request block.
  • Returns complete matched book chunks for search-book operations rather than truncating each match to 300 characters.
  • Adds per-book memory with bounded summaries, focus items, open questions, recent questions, and periodic compaction.
  • Keeps mobile/web behavior guarded behind optional platform methods.

Validation

  • pnpm run test passed: 38 files, 371 tests.
  • pnpm run build passed.
  • cargo check passed in packages/app/src-tauri.
  • git diff --check passed.
  • Secret scan for provider key patterns found no committed API keys.

Notes

This PR intentionally does not include any DeepSeek, Anthropic, or OpenAI API key. The local Claude Code installation is responsible for credentials and model routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant